home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Today - The Disc! 8 / cdrt08.iso / mac / Shareware / HyperCard / demoCdef 120 ƒ / cdef3D source ƒ / cdef Common / grayCDEF.c < prev    next >
Encoding:
Text File  |  1994-12-12  |  1.5 KB  |  54 lines  |  [TEXT/KAHL]

  1. //----------------------------------------------------------------------------------
  2. // File        : grayCDEF.c
  3. // Date        : September 26, 1994
  4. // Author    : Jim Stout
  5. // Purpose    : support routines for CDEF's that can be disabled
  6. //----------------------------------------------------------------------------------
  7. #include <GestaltEqu.h>
  8. #include <Palettes.h>
  9. #include <Traps.h>
  10.  
  11. #include "grayCDEF.h"
  12. #include "miscCDEF.h"
  13.  
  14. //----------------------------------------------------------------------------------
  15. //    Returns true if a System 7 style gray color was available and returns the 
  16. //    grayish color in theGray
  17. //----------------------------------------------------------------------------------
  18.  
  19. extern Boolean getGray(RGBColor *rgbGray)
  20. {
  21.     RGBColor    rgbBack;
  22.     GDHandle    hThisDevice;
  23.     
  24.     GetForeColor(rgbGray);
  25.     if(getOSVers() >= 0x0700) {
  26.         GetBackColor(&rgbBack);
  27.         hThisDevice = GetGDevice();
  28.         if(GetGray(hThisDevice,&rgbBack,rgbGray))
  29.             return true;
  30.     }
  31.     return false;
  32. }
  33.  
  34. //----------------------------------------------------------------------------------
  35. //    Return true if Gestalt says GrayishTextOr mode is present 
  36. //----------------------------------------------------------------------------------
  37.  
  38. Boolean haveGrayText    (void)
  39. {
  40.     OSErr        err;
  41.     short        bit = gestaltHasGrayishTextOr;
  42.     long        gResult;
  43.     Boolean        result = false;
  44.     
  45.     if(trapAvailable(_Gestalt)) {
  46.         err = Gestalt(gestaltQuickdrawFeatures,&gResult);
  47.         if(err == noErr) {
  48.             if(BitTst(&gResult, 31-bit))
  49.                 result = true;
  50.         }
  51.     }
  52.     return(result);
  53. }
  54.